import request from '@/utils/request'
/**
 * 新增角色
 * @params {code,introduce,manager,name,pid}  data
 * @returns
 */
export const addRoles = (data) => request.post('/sys/role', data)

/**
  * 获取角色列表
  *
  * @returns
  */
export const getRoles = (params) => request.get('/sys/role', { params })

/**
  * 修改角色详情
  * @params {code,introduce,manager,name,pid,id}  data
  * @returns
  */
export const updateRoles = (data) => request.put(`/sys/role/${data.id}`, data)

/**
  * 删除角色
  *
  * @returns
  */
export const delRoles = (id) => request.delete(`/sys/role/${id}`)

/**
  * 获取角色详情
  *
  * @returns
  */
export const getRolesDetail = (id) => request.get(`/sys/role/${id}`)

/**
 * 分配权限
 *
 */
export const assignPremission = (data) => request.put('/sys/role/assignPrem', data)
